<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>Javascript tree with autoscroll</title>
    <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>
    <link rel="stylesheet" href="../extra/css/gridless.css">
    <link rel="stylesheet" href="../extra/prism/prism.css">
    <link rel="stylesheet" href="example.css">
    <link rel="stylesheet" href="../jqtree.css">
    <!--[if lt IE 9]>
        <script src="../extra/js/jquery-1.10.2.min.js"></script>
    <![endif]-->
    <!--[if gte IE 9]><!-->
        <script src="../extra/js/jquery-2.0.3.min.js"></script>
    <!--<![endif]-->
    <script src="../extra/prism/prism.js"></script>
    <script src="../extra/js/jquery.mockjax.js"></script>
    <script src="../extra/example_data.js"></script>
    <script src="../tree.jquery.js"></script>
    <script type="text/javascript">
        var _gaq = _gaq || [];
        _gaq.push(['_setAccount', 'UA-33742133-1']);
        _gaq.push(['_trackPageview']);

        (function() {
            var ga = document.createElement('script');
            ga.type = 'text/javascript';
            ga.async = true;
            ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
            var s = document.getElementsByTagName('script')[0];
            s.parentNode.insertBefore(ga, s);
        })();
    </script>
</head>
<body>
    <p id="nav">
        <a href="autoescape.html">&laquo; Example 6</a>
        
            <a href="multiple_select.html" class="next">Example 8 &raquo;</a>
        
    </p>

    <h1>Example 7 - autoscroll</h1>

    
    <div id="scroll-container">
        <div id="tree1"></div>
    </div>

    <p>
        This is an example of autoscroll. The tree will scroll automatically if you drag an item outside of the tree.
        <br />
        Autoscroll will work automatically. There is no option for it.
    </p>

    <script>
        $(function() {
            var $tree = $('#tree1');
            $tree.tree({
                data: ExampleData.example_data,
                dragAndDrop: true,
                autoOpen: true
            });
        });
    </script>

</body>
</html>